#include <iostream>
using std::cout;
using std::endl;


int gNum = 100;

void test0(){
    static int sNum = 20;

    int lNum = 1;
    int lNum2 = 10;
    cout << &lNum2 << endl;
    cout << &lNum << endl;

    cout << endl;
    int * p = new int(10);

    int * p2 = new int(20);
    cout << p2 << endl;
    cout << p << endl;

    cout << endl;
    //同一个区中存放的变量先定义的在比较低的地址
    cout << &sNum << endl;
    cout << &gNum << endl;

    const char * pstr = "hello";
    /* cout << &pstr << endl; */
    cout << pstr << endl;
    printf("%p\n",pstr);
    cout << static_cast<const void *>(pstr) << endl;
    cout << static_cast<void*>(const_cast<char*>(pstr)) << endl;

    cout << endl;
    /* cout << &test0 << endl; */
    printf("%p\n",&test0);
}

int main(void){
    test0();
    printf("%p\n",&main);
    return 0;
}
